package ssm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ssm.dao.Student;
import ssm.dao.Yhzpb;
import ssm.model.StudentMapper;
import ssm.model.YhzpbMapper;

import java.util.HashMap;
import java.util.Map;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;
    @Autowired
    private YhzpbMapper yhzpbMapper;

    public Student getByXh(String xh) {
        Student student = studentMapper.getByXh(xh);
        Yhzpb yhzpb = yhzpbMapper.findByJid(xh);
        if (yhzpb != null) {
            byte[] zp = yhzpbMapper.findByJid(xh).getZp();
            System.out.println(zp);
            student.setZp(zp);
        }

        return student;
    }
}
